﻿
/*
NAILSUPERSTORE ® COMPANY
 
[HISTORY]
Created By  	: NGUYEN VAN TY
Created Date	: 12/17/2010
Modified By     :
Modified Date   :
Note            :

*/

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using CommonTagTime.DataAccess;
using CommonTagTime.ModelObject;
namespace CommonTagTime.Business
{
    public class busDocument
    {
        //------------------------------------------------
        //FIELD TABLE
        //------------------------------------------------
        public const string TABLE = "Document";
        public const string DOCUMENTID = "DocumentID";
        public const string SORTORDER = "SortOrder";
        public const string ISACTIVE = "IsActive";
        public const string FILENAME = "FileName";
        public const string NAME = "Name";        
        public const string CREATEDBY = "CreatedBy";
        public const string CREATEDDATE = "CreatedDate";
        public const string UPDATEDBY = "UpdatedBy";
        public const string UPDATEDDATE = "UpdatedDate";       
        public const string ORDERBY = "OrderBy";
        public const string ORDERDIRECTION = "OrderDirection";
        public const string CURRENTPAGE = "CurrentPage";
        public const string PAGESIZE = "PageSize";     
        public const string TOTALRECORDS = "TotalRecords";
        public const string CONDITION = "Condition";
        public const string SIZE = "Size";
        public const string COLOR = "Color";
        public const string MATERIAL = "Material";

        private daoDocument _daoDocument;
        //------------------------------------------------
        //PUBLIC
        //------------------------------------------------
        public busDocument()
        {
            _daoDocument = new daoDocument();
        }
        public int Insert(Document objDocument)
        {
            if (objDocument == null)
                return 0;
            return _daoDocument.Insert(objDocument);
        }
        public bool Update(Document objDocument)
        {
            if (objDocument == null)
                return false;
            return _daoDocument.Update(objDocument);
        }
        public bool Active(int DocumentID)
        {
            if (DocumentID<=0)
                return false;
            return _daoDocument.Active(DocumentID);
        }
        public bool DeActive(int DocumentID)
        {
            if (DocumentID <= 0)
                return false;
            return _daoDocument.DeActive(DocumentID);
        }
        public bool OrderDown(int DocumentID)
        {
            if (DocumentID <= 0)
                return false;
            return _daoDocument.OrderDown(DocumentID);
        }
        public bool OrderUp(int DocumentID)
        {
            if (DocumentID <= 0)
                return false;
            return _daoDocument.OrderUp(DocumentID);
        }

        public bool Delete(int DocumentID)
        {
            if (DocumentID <= 0)
                return false;
            return _daoDocument.Delete(DocumentID);
        }
        public Document GetByID(int _TipID)
        {
            if (_TipID <= 0)
                return null;
            return _daoDocument.GetByID(_TipID);
        }
        public DocumentCollection List(Document objDocument)
        {
            return _daoDocument.List(objDocument);
        }
        public DocumentCollection GetListByProductID(Document objDocument)
        {
          
            return _daoDocument.GetListByProductID(objDocument);
        }
    }

}
